package com.park.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.park.entity.Park;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ParkMapper extends BaseMapper<Park> {
    @Select("SELECT * FROM park WHERE park_car_id LIKE CONCAT('%', #{id}, '%')")
    IPage<Park> getByParkCarId(Page<?> page, @Param("id") String id);

    @Select("SELECT * FROM park WHERE park_out_time is null")
    List<Park> getByParkOutTimeIsNull();
}
